//
//  ViewController.m
//  LZFInfiniteScrollView2封装版
//
//  Created by 梁梓烽 on 16/7/5.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

#import "ViewController.h"
#import "LZFInfiniteScrollView.h"

@interface ViewController ()<LZFInfiniteScrollViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    LZFInfiniteScrollView *view=[[LZFInfiniteScrollView alloc]init];
    
    //考虑图片轮播器现实的是远程图片,外面传的是url
    //既然涉及到下载远程图片,那么就考虑加上占位图片.提供占位图片属性给外界
    //占位图片要打包到bundle中,防止和项目中的其他地方产生冲突
    //提供代理属性,供外界去去监听到它内部的事情
    view.images=@[[UIImage imageNamed:@"img_00"],
                  [UIImage imageNamed:@"img_01"],
                  [NSURL URLWithString:@"http://tupian.enterdesk.com/2013/mxy/12/10/15/3.jpg"],
                  [UIImage imageNamed:@"img_03"],
                  [UIImage imageNamed:@"img_03"],
                  [NSURL URLWithString:@"http://pic4.nipic.com/20091215/2396136_140959028451_2.jpg"]
                  ];
    
    view.delegate=self;
    
     view.frame=CGRectMake(0, 0, 375, 200);
    [self.view addSubview:view];
    
    
}

-(void)infiniteScrollView:(LZFInfiniteScrollView *)infiniteScrollView didClickImage:(NSInteger)index
{
    NSLog(@"%ld",index);
}

@end
